/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.sistemas.sse.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pe.edu.sistemas.sse.dao.IUbigeoDepartamentoDao;
import pe.edu.sistemas.sse.entity.UbigeoDepartamento;
import pe.edu.sistemas.sse.service.IAdminService;
import pe.edu.sistemas.sse.util.converter.UbigeoConverter;

/**
 *
 * @author laptop-w8
 */
@Service("adminService")
@Transactional(readOnly = true)
public class AdminService implements IAdminService {

//    @Autowired
    IUbigeoDepartamentoDao departamentoDao;

    @Override
    public boolean registrarUbigeo(String nombreArchivo) {
        List<UbigeoDepartamento> l = UbigeoConverter.obtenerDepartamentos(nombreArchivo);

        if (l != null && l.size() > 0) {
            return departamentoDao.agregarListaDepartamento(l);
        }
        return false;
    }

}
